home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / DateCalc / datum.jar / InfoForm.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-11-29  |  2.2 KB  |  44 lines

  1. import java.io.IOException;
  2. import javax.microedition.lcdui.Command;
  3. import javax.microedition.lcdui.CommandListener;
  4. import javax.microedition.lcdui.Displayable;
  5. import javax.microedition.lcdui.Form;
  6. import javax.microedition.lcdui.Image;
  7. import javax.microedition.lcdui.Screen;
  8. import javax.microedition.lcdui.StringItem;
  9. import javax.microedition.lcdui.Ticker;
  10.  
  11. public class InfoForm extends Form implements CommandListener {
  12.    private StringItem text;
  13.    private Datum midlet;
  14.    private Image logo;
  15.  
  16.    public InfoForm(String title) {
  17.       super(title);
  18.       ((Displayable)this).setCommandListener(this);
  19.       Command selectLangCommand = new Command("Abbruch", 1, 0);
  20.       ((Screen)this).setTicker(new Ticker("visit engelrico.de for fun and ProgrammingNews...  "));
  21.       String info = new String("Ein Programmm zum Untersuchen eines beliebigen Datums. Viel Spa├ƒ beim Rumspielen!");
  22.       this.text = new StringItem("Info", info);
  23.       ((Displayable)this).addCommand(selectLangCommand);
  24.       ((Form)this).append(this.text);
  25.  
  26.       try {
  27.          this.logo = Image.createImage("/images/logo_max.png");
  28.       } catch (IOException var5) {
  29.       }
  30.  
  31.    }
  32.  
  33.    public void commandAction(Command command, Displayable displayable) {
  34.       if (command.getLabel().equals("Abbruch")) {
  35.          this.midlet.viewStartForm();
  36.       }
  37.  
  38.    }
  39.  
  40.    public void setMidlet(Datum m) {
  41.       this.midlet = m;
  42.    }
  43. }
  44.